<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate1 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('box_rooms', function (Blueprint $table) {
            $table->json('open_records')->nullable()->after('sku_status')->comment('开盒记录');
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->tinyInteger('open_box_strategy')->default(1)->after('sku_ratio_type')->comment('开盒算法 1为按库存比例随机  2为优化开出该房间中未开过的SKU');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('box_rooms', function (Blueprint $table) {
            $table->dropColumn('open_records');
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->dropColumn('open_box_strategy');
        });
    }
}
